﻿namespace SuperMarieApi.App.Controllers.Framework.Common
{
    using System;

    public static class ObjectExtensions
    {
        public static bool ToBool(this object obj)
        {
            return ConvertHelper.ObjToBool(obj);
        }

        public static bool CharToBool(this object obj)
        {
            bool f = obj.ToString().Equals("y", StringComparison.CurrentCultureIgnoreCase);
            return f;
        }

        public static DateTime? ToDateNull(this object obj)
        {
            return ConvertHelper.ObjToDateNull(obj);
        }

        public static decimal ToDecimal(this object obj)
        {
            return ConvertHelper.ObjToDecimal(obj);
        }

        public static decimal? ToDecimalNull(this object obj)
        {
            return ConvertHelper.ObjToDecimalNull(obj);
        }

        public static int ToInt(this object obj)
        {
            return ConvertHelper.ObjToInt(obj);
        }

        public static int? ToIntNull(this object obj)
        {
            return ConvertHelper.ObjToIntNull(obj);
        }

        public static string ToStr(this object obj)
        {
            return ConvertHelper.ObjToStr(obj);
        }
    }
}
